From ec89e9460bd7e761dcce270296c46c8a0d71b8e1 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 10 Jan 2004 01:19:53 +0000 Subject: [PATCH] (mode-line-change-eol): Add EVENT parameter. Temporarily select EVENT's window for changing eol type. --- lisp/bindings.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/bindings.el b/lisp/bindings.el index ed4da745b2d..1f86f3b6fcb 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -135,12 +135,14 @@ corresponding to the mode line clicked." "Local keymap for the coding-system part of the mode line.") -(defun mode-line-change-eol () +(defun mode-line-change-eol (event) "Cycle through the various possible kinds of end-of-line styles." - (interactive) - (let ((eol (coding-system-eol-type buffer-file-coding-system))) - (set-buffer-file-coding-system - (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix))))) + (interactive "e") + (save-selected-window + (select-window (posn-window (event-start event))) + (let ((eol (coding-system-eol-type buffer-file-coding-system))) + (set-buffer-file-coding-system + (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix)))))) (defvar mode-line-eol-desc-cache nil) -- 2.30.2